<template>
	<div class="app_content">
		<mt-header fixed title="标题过长会隐藏后面的内容啊哈哈哈哈">
			<mt-button icon="back" slot="left" @click="backgo" v-show="isShow">返回</mt-button>
			<mt-button icon="more" slot="right"></mt-button>
		</mt-header>
		<div class="content">
			<transition name="tl">
				<router-view></router-view>
			</transition>
		</div>
		<nav class="mui-bar mui-bar-tab">
			<router-link class="mui-tab-item" to="/home">
				<span class="mui-icon mui-icon-home"></span>
				<span class="mui-tab-label">首页123456</span>
			</router-link>
			<router-link class="mui-tab-item" to="/member">
				<span class="mui-icon mui-icon-personadd"></span>
				<span class="mui-tab-label">会员123</span>
			</router-link>
			<router-link class="mui-tab-item" to="/shopCar">
				<span class="mui-icon mui-icon-chat"><span class="mui-badge">{{$store.getters.getAllCount}}</span></span>
				<span class="mui-tab-label">购物车</span>
			</router-link>
			<router-link class="mui-tab-item" to="/search">
				<span class="mui-icon mui-icon-search"></span>
				<span class="mui-tab-label">搜索123</span>
			</router-link>
		</nav>
	</div>
</template>
<script>
	export default {
		data(){
			return {
				isShow:false
			}
		},
		methods:{
			backgo(){
				this.$router.go(-1);
			}
		},
		watch:{
			"$route.path":function(val){
				console.log(val);
				if(val == '/home'){
					this.isShow = false;
				}else{
					this.isShow = true;
				}
			}
		}
	}
</script>
<style scoped lang="less">
.app_content{
	padding:40px 0px;
}
.tl-enter{
	opacity:0;
	transform:translate(100%,0);
	position:absolute;
}
.tl-leave-to{
	opacity:0;
	transform:translate(-100%,0);
	position:absolute;
}
.tl-enter-active,.tl-leave-active{
	transition:all .3s ease;
}
</style>